﻿using Microsoft.TeamFoundation.WorkItemTracking.Client;
using System.Windows.Forms;
using Microsoft.TeamFoundation.VersionControl.Client;
using System.Collections.Generic;

namespace TfsMerge.Interface
{
    public interface ITfs
    {
        void Reconnect();


        WorkItem GetWorkItem(int id);


        int? CheckIn(string branch, string comment, int? associatedWorkItemId);

        void Undo(string branch);


        GetStatus Get(string[] items, VersionSpec version, RecursionType recursion, GetOptions options);

        Changeset GetChangeset(int changesetId);

        IEnumerable<Changeset> GetHistory(string branch, int size = int.MaxValue);

        MergeCandidate[] GetMergeCandidates(string sourceBranch, string targetBranch);

        GetStatus CheckMerge(string sourceBranch, string targetBranch, int changesetId);

        GetStatus Merge(string sourceBranch, string targetBranch, int changesetId);

        GetStatus Merge(string sourceBranch, string targetBranch, int changesetIdStart, int changesetIdEnd);

        Conflict[] GetConflicts(string branch);


        IEnumerable<WorkItem> ExecQuery(QueryDefinition queryDef);


        void ShowChangesetDetailsDialog(Form owner, int changesetId);

        void ShowConflictsDialog(Form owner, Conflict[] conflicts);

        void ShowWorkItemDialog(Form owner, int id);

        WorkItem ShowWorkItemSelectorDialog(Form owner);

        void ShowTrackView(Form owner, int changesetId);


        IEnumerable<BranchObject> GetBranches();

        IEnumerable<ItemIdentifier> GetRelBranches(string branch);

        IEnumerable<BranchObject> GetBranchHierarchy(string branch);

        IEnumerable<BranchObject> GetBranchHierarchy(int changesetId);

        string GetBranch(int changesetId);

        IEnumerable<ExtendedMerge> TrackMerges(int changesetId);

        

        void AutoMergeResolveConflict(Conflict conflict);

        void TakeSourceResolveConflict(Conflict conflict);
    }
}
